package com.qf.ebook.controller;

import com.qf.ebook.entity.EbookCategory;
import com.qf.ebook.service.EbookCategoryService;
import com.qf.ebook.util.R;
import com.qf.ebook.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController  // == @Controller + @ResponseBody
@RequestMapping("/category")
public class EbookCategoryController {

    @Autowired
    private EbookCategoryService categoryService;

    @GetMapping("/list")
    public ResultVO list() {
        List<EbookCategory> list = categoryService.list();
        return R.ok(list);

    }









}
